home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / gpssdk / GPS.NET Global Positioning SDK 1.4.6.msi / Data1.cab / NewWaypointForm.vb3 < prev    next >
Encoding:
Text File  |  2004-08-25  |  22.1 KB  |  533 lines

  1. Imports StormSource.Gps
  2.  
  3. Public Class NewWaypointForm
  4.     Inherits System.Windows.Forms.Form
  5.  
  6. #Region " Windows Form Designer generated code "
  7.  
  8.     Public Sub New()
  9.         MyBase.New()
  10.  
  11.         'This call is required by the Windows Form Designer.
  12.         InitializeComponent()
  13.  
  14.         'Add any initialization after the InitializeComponent() call
  15.  
  16.     End Sub
  17.  
  18.     'Form overrides dispose to clean up the component list.
  19.     Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  20.         If disposing Then
  21.             If Not (components Is Nothing) Then
  22.                 components.Dispose()
  23.             End If
  24.         End If
  25.         MyBase.Dispose(disposing)
  26.     End Sub
  27.  
  28.     'Required by the Windows Form Designer
  29.     Private components As System.ComponentModel.IContainer
  30.  
  31.     'NOTE: The following procedure is required by the Windows Form Designer
  32.     'It can be modified using the Windows Form Designer.  
  33.     'Do not modify it using the code editor.
  34.     Friend WithEvents Label2 As System.Windows.Forms.Label
  35.     Friend WithEvents btnCancelButton As System.Windows.Forms.Button
  36.     Friend WithEvents WaypointNameLabel As System.Windows.Forms.Label
  37.     Friend WithEvents WaypointName As System.Windows.Forms.TextBox
  38.     Friend WithEvents SymbolLabel As System.Windows.Forms.Label
  39.     Friend WithEvents TabControl As System.Windows.Forms.TabControl
  40.     Friend WithEvents GeneralTab As System.Windows.Forms.TabPage
  41.     Friend WithEvents Position As System.Windows.Forms.TextBox
  42.     Friend WithEvents WaypointDisplayModeComboBox As System.Windows.Forms.ComboBox
  43.     Friend WithEvents WaypointSymbolComboBox As System.Windows.Forms.ComboBox
  44.     Friend WithEvents WaypointColorComboBox As System.Windows.Forms.ComboBox
  45.     Friend WithEvents ColorLabel As System.Windows.Forms.Label
  46.     Friend WithEvents DisplayModeLabel As System.Windows.Forms.Label
  47.     Friend WithEvents Depth As System.Windows.Forms.TextBox
  48.     Friend WithEvents DepthLabel As System.Windows.Forms.Label
  49.     Friend WithEvents Altitude As System.Windows.Forms.TextBox
  50.     Friend WithEvents AltitudeLabel As System.Windows.Forms.Label
  51.     Friend WithEvents City As System.Windows.Forms.TextBox
  52.     Friend WithEvents CityLabel As System.Windows.Forms.Label
  53.     Friend WithEvents Address As System.Windows.Forms.TextBox
  54.     Friend WithEvents AddressLabel As System.Windows.Forms.Label
  55.     Friend WithEvents Country As System.Windows.Forms.TextBox
  56.     Friend WithEvents CountryLabel As System.Windows.Forms.Label
  57.     Friend WithEvents State As System.Windows.Forms.TextBox
  58.     Friend WithEvents StateLabel As System.Windows.Forms.Label
  59.     Friend WithEvents IntersectingRoad As System.Windows.Forms.TextBox
  60.     Friend WithEvents IntersectingRoadLabel As System.Windows.Forms.Label
  61.     Friend WithEvents FacilityLabel As System.Windows.Forms.Label
  62.     Friend WithEvents Facility As System.Windows.Forms.TextBox
  63.     Friend WithEvents SaveButton As System.Windows.Forms.Button
  64.     Friend WithEvents Description As System.Windows.Forms.TextBox
  65.     Friend WithEvents DescriptionLabel As System.Windows.Forms.Label
  66.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  67.         Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(NewWaypointForm))
  68.         Me.WaypointDisplayModeComboBox = New System.Windows.Forms.ComboBox()
  69.         Me.WaypointSymbolComboBox = New System.Windows.Forms.ComboBox()
  70.         Me.WaypointNameLabel = New System.Windows.Forms.Label()
  71.         Me.WaypointName = New System.Windows.Forms.TextBox()
  72.         Me.btnCancelButton = New System.Windows.Forms.Button()
  73.         Me.SaveButton = New System.Windows.Forms.Button()
  74.         Me.Position = New System.Windows.Forms.TextBox()
  75.         Me.Label2 = New System.Windows.Forms.Label()
  76.         Me.Description = New System.Windows.Forms.TextBox()
  77.         Me.DescriptionLabel = New System.Windows.Forms.Label()
  78.         Me.SymbolLabel = New System.Windows.Forms.Label()
  79.         Me.ColorLabel = New System.Windows.Forms.Label()
  80.         Me.WaypointColorComboBox = New System.Windows.Forms.ComboBox()
  81.         Me.DisplayModeLabel = New System.Windows.Forms.Label()
  82.         Me.Depth = New System.Windows.Forms.TextBox()
  83.         Me.DepthLabel = New System.Windows.Forms.Label()
  84.         Me.Altitude = New System.Windows.Forms.TextBox()
  85.         Me.AltitudeLabel = New System.Windows.Forms.Label()
  86.         Me.City = New System.Windows.Forms.TextBox()
  87.         Me.CityLabel = New System.Windows.Forms.Label()
  88.         Me.Address = New System.Windows.Forms.TextBox()
  89.         Me.AddressLabel = New System.Windows.Forms.Label()
  90.         Me.Country = New System.Windows.Forms.TextBox()
  91.         Me.CountryLabel = New System.Windows.Forms.Label()
  92.         Me.State = New System.Windows.Forms.TextBox()
  93.         Me.StateLabel = New System.Windows.Forms.Label()
  94.         Me.IntersectingRoad = New System.Windows.Forms.TextBox()
  95.         Me.IntersectingRoadLabel = New System.Windows.Forms.Label()
  96.         Me.TabControl = New System.Windows.Forms.TabControl()
  97.         Me.GeneralTab = New System.Windows.Forms.TabPage()
  98.         Me.FacilityLabel = New System.Windows.Forms.Label()
  99.         Me.Facility = New System.Windows.Forms.TextBox()
  100.         Me.TabControl.SuspendLayout()
  101.         Me.GeneralTab.SuspendLayout()
  102.         Me.SuspendLayout()
  103.         '
  104.         'WaypointDisplayModeComboBox
  105.         '
  106.         Me.WaypointDisplayModeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  107.                                 Or System.Windows.Forms.AnchorStyles.Right)
  108.         Me.WaypointDisplayModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  109.         Me.WaypointDisplayModeComboBox.Location = New System.Drawing.Point(120, 126)
  110.         Me.WaypointDisplayModeComboBox.Name = "WaypointDisplayModeComboBox"
  111.         Me.WaypointDisplayModeComboBox.Size = New System.Drawing.Size(264, 21)
  112.         Me.WaypointDisplayModeComboBox.Sorted = True
  113.         Me.WaypointDisplayModeComboBox.TabIndex = 11
  114.         '
  115.         'WaypointSymbolComboBox
  116.         '
  117.         Me.WaypointSymbolComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  118.                                 Or System.Windows.Forms.AnchorStyles.Right)
  119.         Me.WaypointSymbolComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  120.         Me.WaypointSymbolComboBox.Location = New System.Drawing.Point(120, 78)
  121.         Me.WaypointSymbolComboBox.Name = "WaypointSymbolComboBox"
  122.         Me.WaypointSymbolComboBox.Size = New System.Drawing.Size(264, 21)
  123.         Me.WaypointSymbolComboBox.Sorted = True
  124.         Me.WaypointSymbolComboBox.TabIndex = 7
  125.         '
  126.         'WaypointNameLabel
  127.         '
  128.         Me.WaypointNameLabel.Location = New System.Drawing.Point(9, 9)
  129.         Me.WaypointNameLabel.Name = "WaypointNameLabel"
  130.         Me.WaypointNameLabel.Size = New System.Drawing.Size(99, 15)
  131.         Me.WaypointNameLabel.TabIndex = 0
  132.         Me.WaypointNameLabel.Text = "Name:"
  133.         '
  134.         'WaypointName
  135.         '
  136.         Me.WaypointName.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  137.                                 Or System.Windows.Forms.AnchorStyles.Right)
  138.         Me.WaypointName.Location = New System.Drawing.Point(120, 6)
  139.         Me.WaypointName.Name = "WaypointName"
  140.         Me.WaypointName.Size = New System.Drawing.Size(264, 20)
  141.         Me.WaypointName.TabIndex = 1
  142.         Me.WaypointName.Text = ""
  143.         '
  144.         'btnCancelButton
  145.         '
  146.         Me.btnCancelButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
  147.         Me.btnCancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel
  148.         Me.btnCancelButton.Location = New System.Drawing.Point(339, 396)
  149.         Me.btnCancelButton.Name = "btnCancelButton"
  150.         Me.btnCancelButton.Size = New System.Drawing.Size(72, 24)
  151.         Me.btnCancelButton.TabIndex = 2
  152.         Me.btnCancelButton.Text = "Cancel"
  153.         '
  154.         'SaveButton
  155.         '
  156.         Me.SaveButton.Anchor = (System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right)
  157.         Me.SaveButton.DialogResult = System.Windows.Forms.DialogResult.OK
  158.         Me.SaveButton.Location = New System.Drawing.Point(261, 396)
  159.         Me.SaveButton.Name = "SaveButton"
  160.         Me.SaveButton.Size = New System.Drawing.Size(72, 24)
  161.         Me.SaveButton.TabIndex = 1
  162.         Me.SaveButton.Text = "Save"
  163.         '
  164.         'Position
  165.         '
  166.         Me.Position.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  167.                                 Or System.Windows.Forms.AnchorStyles.Right)
  168.         Me.Position.Location = New System.Drawing.Point(120, 30)
  169.         Me.Position.Name = "Position"
  170.         Me.Position.Size = New System.Drawing.Size(264, 20)
  171.         Me.Position.TabIndex = 3
  172.         Me.Position.Text = ""
  173.         '
  174.         'Label2
  175.         '
  176.         Me.Label2.Location = New System.Drawing.Point(9, 33)
  177.         Me.Label2.Name = "Label2"
  178.         Me.Label2.Size = New System.Drawing.Size(99, 15)
  179.         Me.Label2.TabIndex = 2
  180.         Me.Label2.Text = "Position:"
  181.         '
  182.         'Description
  183.         '
  184.         Me.Description.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  185.                                 Or System.Windows.Forms.AnchorStyles.Right)
  186.         Me.Description.Location = New System.Drawing.Point(120, 54)
  187.         Me.Description.Name = "Description"
  188.         Me.Description.Size = New System.Drawing.Size(264, 20)
  189.         Me.Description.TabIndex = 5
  190.         Me.Description.Text = ""
  191.         '
  192.         'DescriptionLabel
  193.         '
  194.         Me.DescriptionLabel.Location = New System.Drawing.Point(9, 57)
  195.         Me.DescriptionLabel.Name = "DescriptionLabel"
  196.         Me.DescriptionLabel.Size = New System.Drawing.Size(99, 15)
  197.         Me.DescriptionLabel.TabIndex = 4
  198.         Me.DescriptionLabel.Text = "Description:"
  199.         '
  200.         'SymbolLabel
  201.         '
  202.         Me.SymbolLabel.Location = New System.Drawing.Point(9, 81)
  203.         Me.SymbolLabel.Name = "SymbolLabel"
  204.         Me.SymbolLabel.Size = New System.Drawing.Size(99, 15)
  205.         Me.SymbolLabel.TabIndex = 6
  206.         Me.SymbolLabel.Text = "Symbol:"
  207.         '
  208.         'ColorLabel
  209.         '
  210.         Me.ColorLabel.Location = New System.Drawing.Point(9, 105)
  211.         Me.ColorLabel.Name = "ColorLabel"
  212.         Me.ColorLabel.Size = New System.Drawing.Size(99, 15)
  213.         Me.ColorLabel.TabIndex = 8
  214.         Me.ColorLabel.Text = "Color:"
  215.         '
  216.         'WaypointColorComboBox
  217.         '
  218.         Me.WaypointColorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  219.                                 Or System.Windows.Forms.AnchorStyles.Right)
  220.         Me.WaypointColorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
  221.         Me.WaypointColorComboBox.Location = New System.Drawing.Point(120, 102)
  222.         Me.WaypointColorComboBox.Name = "WaypointColorComboBox"
  223.         Me.WaypointColorComboBox.Size = New System.Drawing.Size(264, 21)
  224.         Me.WaypointColorComboBox.Sorted = True
  225.         Me.WaypointColorComboBox.TabIndex = 9
  226.         '
  227.         'DisplayModeLabel
  228.         '
  229.         Me.DisplayModeLabel.Location = New System.Drawing.Point(9, 129)
  230.         Me.DisplayModeLabel.Name = "DisplayModeLabel"
  231.         Me.DisplayModeLabel.Size = New System.Drawing.Size(99, 15)
  232.         Me.DisplayModeLabel.TabIndex = 10
  233.         Me.DisplayModeLabel.Text = "Display Mode:"
  234.         '
  235.         'Depth
  236.         '
  237.         Me.Depth.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  238.                                 Or System.Windows.Forms.AnchorStyles.Right)
  239.         Me.Depth.Location = New System.Drawing.Point(120, 174)
  240.         Me.Depth.Name = "Depth"
  241.         Me.Depth.Size = New System.Drawing.Size(264, 20)
  242.         Me.Depth.TabIndex = 15
  243.         Me.Depth.Text = ""
  244.         '
  245.         'DepthLabel
  246.         '
  247.         Me.DepthLabel.Location = New System.Drawing.Point(9, 177)
  248.         Me.DepthLabel.Name = "DepthLabel"
  249.         Me.DepthLabel.Size = New System.Drawing.Size(99, 15)
  250.         Me.DepthLabel.TabIndex = 14
  251.         Me.DepthLabel.Text = "Depth:"
  252.         '
  253.         'Altitude
  254.         '
  255.         Me.Altitude.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  256.                                 Or System.Windows.Forms.AnchorStyles.Right)
  257.         Me.Altitude.Location = New System.Drawing.Point(120, 150)
  258.         Me.Altitude.Name = "Altitude"
  259.         Me.Altitude.Size = New System.Drawing.Size(264, 20)
  260.         Me.Altitude.TabIndex = 13
  261.         Me.Altitude.Text = ""
  262.         '
  263.         'AltitudeLabel
  264.         '
  265.         Me.AltitudeLabel.Location = New System.Drawing.Point(9, 153)
  266.         Me.AltitudeLabel.Name = "AltitudeLabel"
  267.         Me.AltitudeLabel.Size = New System.Drawing.Size(99, 15)
  268.         Me.AltitudeLabel.TabIndex = 12
  269.         Me.AltitudeLabel.Text = "Altitude:"
  270.         '
  271.         'City
  272.         '
  273.         Me.City.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  274.                                 Or System.Windows.Forms.AnchorStyles.Right)
  275.         Me.City.Location = New System.Drawing.Point(120, 246)
  276.         Me.City.Name = "City"
  277.         Me.City.Size = New System.Drawing.Size(264, 20)
  278.         Me.City.TabIndex = 21
  279.         Me.City.Text = ""
  280.         '
  281.         'CityLabel
  282.         '
  283.         Me.CityLabel.Location = New System.Drawing.Point(9, 249)
  284.         Me.CityLabel.Name = "CityLabel"
  285.         Me.CityLabel.Size = New System.Drawing.Size(99, 15)
  286.         Me.CityLabel.TabIndex = 20
  287.         Me.CityLabel.Text = "City:"
  288.         '
  289.         'Address
  290.         '
  291.         Me.Address.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  292.                                 Or System.Windows.Forms.AnchorStyles.Right)
  293.         Me.Address.Location = New System.Drawing.Point(120, 222)
  294.         Me.Address.Name = "Address"
  295.         Me.Address.Size = New System.Drawing.Size(264, 20)
  296.         Me.Address.TabIndex = 19
  297.         Me.Address.Text = ""
  298.         '
  299.         'AddressLabel
  300.         '
  301.         Me.AddressLabel.Location = New System.Drawing.Point(9, 225)
  302.         Me.AddressLabel.Name = "AddressLabel"
  303.         Me.AddressLabel.Size = New System.Drawing.Size(99, 15)
  304.         Me.AddressLabel.TabIndex = 18
  305.         Me.AddressLabel.Text = "Address:"
  306.         '
  307.         'Country
  308.         '
  309.         Me.Country.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  310.                                 Or System.Windows.Forms.AnchorStyles.Right)
  311.         Me.Country.Location = New System.Drawing.Point(120, 294)
  312.         Me.Country.MaxLength = 2
  313.         Me.Country.Name = "Country"
  314.         Me.Country.Size = New System.Drawing.Size(264, 20)
  315.         Me.Country.TabIndex = 25
  316.         Me.Country.Text = ""
  317.         '
  318.         'CountryLabel
  319.         '
  320.         Me.CountryLabel.Location = New System.Drawing.Point(9, 297)
  321.         Me.CountryLabel.Name = "CountryLabel"
  322.         Me.CountryLabel.Size = New System.Drawing.Size(99, 15)
  323.         Me.CountryLabel.TabIndex = 24
  324.         Me.CountryLabel.Text = "Country:"
  325.         '
  326.         'State
  327.         '
  328.         Me.State.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  329.                                 Or System.Windows.Forms.AnchorStyles.Right)
  330.         Me.State.Location = New System.Drawing.Point(120, 270)
  331.         Me.State.MaxLength = 2
  332.         Me.State.Name = "State"
  333.         Me.State.Size = New System.Drawing.Size(264, 20)
  334.         Me.State.TabIndex = 23
  335.         Me.State.Text = ""
  336.         '
  337.         'StateLabel
  338.         '
  339.         Me.StateLabel.Location = New System.Drawing.Point(9, 273)
  340.         Me.StateLabel.Name = "StateLabel"
  341.         Me.StateLabel.Size = New System.Drawing.Size(99, 15)
  342.         Me.StateLabel.TabIndex = 22
  343.         Me.StateLabel.Text = "State:"
  344.         '
  345.         'IntersectingRoad
  346.         '
  347.         Me.IntersectingRoad.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  348.                                 Or System.Windows.Forms.AnchorStyles.Right)
  349.         Me.IntersectingRoad.Location = New System.Drawing.Point(120, 318)
  350.         Me.IntersectingRoad.Name = "IntersectingRoad"
  351.         Me.IntersectingRoad.Size = New System.Drawing.Size(264, 20)
  352.         Me.IntersectingRoad.TabIndex = 27
  353.         Me.IntersectingRoad.Text = ""
  354.         '
  355.         'IntersectingRoadLabel
  356.         '
  357.         Me.IntersectingRoadLabel.Location = New System.Drawing.Point(9, 321)
  358.         Me.IntersectingRoadLabel.Name = "IntersectingRoadLabel"
  359.         Me.IntersectingRoadLabel.Size = New System.Drawing.Size(99, 15)
  360.         Me.IntersectingRoadLabel.TabIndex = 26
  361.         Me.IntersectingRoadLabel.Text = "Intersecting Road:"
  362.         '
  363.         'TabControl
  364.         '
  365.         Me.TabControl.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
  366.                                 Or System.Windows.Forms.AnchorStyles.Left) _
  367.                                 Or System.Windows.Forms.AnchorStyles.Right)
  368.         Me.TabControl.Controls.AddRange(New System.Windows.Forms.Control() {Me.GeneralTab})
  369.         Me.TabControl.Location = New System.Drawing.Point(9, 9)
  370.         Me.TabControl.Name = "TabControl"
  371.         Me.TabControl.SelectedIndex = 0
  372.         Me.TabControl.Size = New System.Drawing.Size(405, 375)
  373.         Me.TabControl.TabIndex = 0
  374.         '
  375.         'GeneralTab
  376.         '
  377.         Me.GeneralTab.Controls.AddRange(New System.Windows.Forms.Control() {Me.FacilityLabel, Me.Facility, Me.CountryLabel, Me.State, Me.StateLabel, Me.AddressLabel, Me.Address, Me.CityLabel, Me.City, Me.Country, Me.IntersectingRoad, Me.WaypointColorComboBox, Me.WaypointDisplayModeComboBox, Me.DisplayModeLabel, Me.WaypointNameLabel, Me.IntersectingRoadLabel, Me.Label2, Me.Depth, Me.WaypointSymbolComboBox, Me.WaypointName, Me.Position, Me.Description, Me.AltitudeLabel, Me.DepthLabel, Me.SymbolLabel, Me.Altitude, Me.ColorLabel, Me.DescriptionLabel})
  378.         Me.GeneralTab.Location = New System.Drawing.Point(4, 22)
  379.         Me.GeneralTab.Name = "GeneralTab"
  380.         Me.GeneralTab.Size = New System.Drawing.Size(397, 349)
  381.         Me.GeneralTab.TabIndex = 0
  382.         Me.GeneralTab.Text = "General"
  383.         '
  384.         'FacilityLabel
  385.         '
  386.         Me.FacilityLabel.Location = New System.Drawing.Point(9, 201)
  387.         Me.FacilityLabel.Name = "FacilityLabel"
  388.         Me.FacilityLabel.Size = New System.Drawing.Size(99, 15)
  389.         Me.FacilityLabel.TabIndex = 16
  390.         Me.FacilityLabel.Text = "Facility Name:"
  391.         '
  392.         'Facility
  393.         '
  394.         Me.Facility.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
  395.                                 Or System.Windows.Forms.AnchorStyles.Right)
  396.         Me.Facility.Location = New System.Drawing.Point(120, 198)
  397.         Me.Facility.Name = "Facility"
  398.         Me.Facility.Size = New System.Drawing.Size(264, 20)
  399.         Me.Facility.TabIndex = 17
  400.         Me.Facility.Text = ""
  401.         '
  402.         'NewWaypointForm
  403.         '
  404.         Me.AcceptButton = Me.SaveButton
  405.         Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  406.         Me.CancelButton = Me.btnCancelButton
  407.         Me.ClientSize = New System.Drawing.Size(423, 433)
  408.         Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.TabControl, Me.btnCancelButton, Me.SaveButton})
  409.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
  410.         Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
  411.         Me.MaximizeBox = False
  412.         Me.MinimizeBox = False
  413.         Me.Name = "NewWaypointForm"
  414.         Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
  415.         Me.Text = "Add Waypoint"
  416.         Me.TabControl.ResumeLayout(False)
  417.         Me.GeneralTab.ResumeLayout(False)
  418.         Me.ResumeLayout(False)
  419.  
  420.     End Sub
  421.  
  422. #End Region
  423.  
  424.     ' Stores information about a GPS device
  425.     Private WithEvents pDevice As Device
  426.  
  427.     ' Returns/sets the device containing waypoint information
  428.     Public Property Device() As Device
  429.         Get
  430.             Return pDevice
  431.         End Get
  432.         Set(ByVal Value As Device)
  433.             ' Remember the waypoint for editing later on
  434.             pDevice = Value
  435.  
  436.             ' Populate the combo box with the list of available waypoint symbols
  437.             WaypointSymbolComboBox.Items.Clear()
  438.             WaypointSymbolComboBox.Items.AddRange(pDevice.GetSymbols)
  439.             WaypointSymbolComboBox.SelectedIndex = WaypointSymbolComboBox.FindString("Dot")
  440.  
  441.             ' Populate the color combo box with the list of available waypoint symbols
  442.             WaypointColorComboBox.Items.Clear()
  443.             WaypointColorComboBox.Items.AddRange(pDevice.GetColors)
  444.             WaypointColorComboBox.SelectedIndex = WaypointColorComboBox.FindString("Default")
  445.  
  446.             ' Populate the display mode box with the list of available waypoint symbols
  447.             WaypointDisplayModeComboBox.Items.Clear()
  448.             WaypointDisplayModeComboBox.Items.AddRange(pDevice.GetDisplayModes)
  449.             WaypointDisplayModeComboBox.SelectedIndex = WaypointDisplayModeComboBox.FindString("SymbolOnly")
  450.  
  451.             ' Now, enable/disable features based on the capabilities of the device
  452.             Description.Enabled = pDevice.SupportsWaypointComment
  453.             Address.Enabled = pDevice.SupportsWaypointAddress
  454.             WaypointSymbolComboBox.Enabled = pDevice.SupportsWaypointSymbol
  455.             WaypointColorComboBox.Enabled = pDevice.SupportsWaypointColor
  456.             WaypointDisplayModeComboBox.Enabled = pDevice.SupportsWaypointDisplayMode
  457.             Facility.Enabled = pDevice.SupportsWaypointFacility
  458.             Address.Enabled = pDevice.SupportsWaypointAddress
  459.             City.Enabled = pDevice.SupportsWaypointCity
  460.             State.Enabled = pDevice.SupportsWaypointState
  461.             Country.Enabled = pDevice.SupportsWaypointCountry
  462.             IntersectingRoad.Enabled = pDevice.SupportsWaypointIntersectingRoad
  463.         End Set
  464.     End Property
  465.  
  466.     Private Sub SaveButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click
  467.         Dim NewWaypoint As Waypoint
  468.         ' Now set the waypoint's properties
  469.         Try
  470.             ' Create a new waypoint 
  471.             NewWaypoint = New Waypoint()
  472.             ' Update the waypoint with values from the form
  473.             NewWaypoint.Name = Me.WaypointName.Text
  474.             ' Update the position
  475.             Dim NewPosition As Position = StormSource.Gps.Position.Parse(Position.Text)
  476.             NewWaypoint.Latitude = NewPosition.Latitude
  477.             NewWaypoint.Longitude = NewPosition.Longitude
  478.             ' Update the comment
  479.             NewWaypoint.Description = Me.Description.Text
  480.             ' Update the symbol
  481.             NewWaypoint.Symbol = System.Enum.Parse(GetType(WaypointSymbol), WaypointSymbolComboBox.Text)
  482.             ' Update the color
  483.             NewWaypoint.Color = System.Enum.Parse(GetType(WaypointColor), WaypointColorComboBox.Text)
  484.             ' Update the symbol
  485.             NewWaypoint.DisplayMode = System.Enum.Parse(GetType(WaypointDisplayMode), WaypointDisplayModeComboBox.Text)
  486.             ' Update the altitude
  487.             Dim NewAltitude As Distance = Distance.Parse(Me.Altitude.Text)
  488.             NewWaypoint.Altitude = NewAltitude
  489.             ' Update the depth
  490.             Dim NewDepth As Distance = Distance.Parse(Me.Depth.Text)
  491.             NewWaypoint.Depth = NewDepth
  492.             ' Update the facility
  493.             NewWaypoint.Facility = Me.Facility.Text
  494.             ' Update the address
  495.             NewWaypoint.Address = Me.Address.Text
  496.             NewWaypoint.City = Me.City.Text
  497.             NewWaypoint.State = Me.State.Text
  498.             NewWaypoint.Country = Me.Country.Text
  499.             ' Update the intersecting road/intersection
  500.             NewWaypoint.IntersectingRoad = Me.IntersectingRoad.Text
  501.         Catch ex As Exception
  502.             ' Some error occurred while try to update waypoint information
  503.             MessageBox.Show(ex.Message, "Form Information is Invalid", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  504.             Exit Sub
  505.         End Try
  506.         Try
  507.             ' Tell the waypoint which kind of GPS device to use
  508.             NewWaypoint.Device = Me.Device
  509.             ' Save this waypoint to the device
  510.             NewWaypoint.Save()
  511.             ' Refresh the waypoints collection
  512.             NewWaypoint.Device.Receiver.Waypoints.Refresh()
  513.             ' And unload this form
  514.             Close()
  515.         Catch ex As Exception
  516.             ' Notify of the problem saving the waypoint
  517.             MessageBox.Show(ex.Message, "Unable to Create Waypoint", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  518.             Exit Sub
  519.         End Try
  520.     End Sub
  521.  
  522.     ' Raised when editing of a waypoint has been cancelled
  523.     Private Sub btnCancelButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancelButton.Click
  524.         Close()
  525.     End Sub
  526.  
  527.     ' Raised when the device becomes identified
  528.     Private Sub pDevice_DeviceIdentified(ByVal sender As Object, ByVal e As StormSource.Gps.DeviceEventArgs) Handles pDevice.DeviceIdentified
  529.         Me.Device = e.Device
  530.     End Sub
  531.  
  532. End Class
  533.